<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<title>vue test</title>
	<script type="text/javascript" src="vue.js"></script>
</head>


<body>

<div id="app">
	<my-btn @click="sayHello">取消111</my-btn>
</div>

<template id="myBtn">
	<button @click="onclick">
		<slot>确定（s）</slot>
	</button>
</template>

<script>
	Vue.component("my-btn",{
		//template: "#myBtn",
		render: function(h){
			return h("button", {
				on: {
					click: this.onclick
				},
				attrs: {
					id: "myid"
				},
				'style': {
					'color': "red"
				}
			}, [this.$slots.default])
		},
		data(){
			return {
				countDown: 0
			}
		},
		methods: {
			onclick(){
				this.$emit("click");
			}
		}
	});
	let app = new Vue({
		el: "#app",
		methods: {
			sayHello(){
				window.alert("hello vue!");
			}
		}
	});
</script>
</body>


</html>